package com.example.lists;

import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

@Data
public class User {
    private Integer id;
    private Integer parentId;
    private String lable;
    private LocalDateTime dateTime;
    private BigDecimal price;

    private List<User> children;

    public User() {
    }

    public User(Integer id, Integer parentId, String lable) {
        this.id = id;
        this.parentId = parentId;
        this.lable = lable;
    }

    public User(Integer parentId, String lable) {
        this.parentId = parentId;
        this.lable = lable;
    }

    public User(Integer id, Integer parentId, String lable, LocalDateTime dateTime) {
        this.id = id;
        this.parentId = parentId;
        this.lable = lable;
        this.dateTime = dateTime;
    }

    public User(Integer id, Integer parentId, String lable, LocalDateTime dateTime, BigDecimal price) {
        this.id = id;
        this.parentId = parentId;
        this.lable = lable;
        this.dateTime = dateTime;
        this.price = price;
    }

    public boolean checkLable(){
        if(this.id == 2 && "老何".equals(this.lable)){
            return true;
        }
        return false;
    }
}
